package locations.actions;

import java.util.ArrayList;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import locations.dao.implement.EspecialidadDAOHibernateJPA;
import locations.model.Especialidad;

public class SpecialityIndexAction extends ActionSupport
{
	private String pageTitle = "Listado de especialidades";
	private List<Especialidad> specialities = new ArrayList();
	
	public String execute() throws Exception
        {
		EspecialidadDAOHibernateJPA dao = new EspecialidadDAOHibernateJPA();
		this.setSpecialities(dao.retrieveAll());
		return SUCCESS;
	}

	public String getPageTitle()
        {
		return pageTitle;
	}

	public void setPageTitle(String pageTitle)
        {
		this.pageTitle = pageTitle;
	}

	public List<Especialidad> getSpecialities()
        {
		return specialities;
	}

	public void setSpecialities(List<Especialidad> specialities)
        {
		this.specialities = specialities;
	}


	
	
	
}
